package com.yazi.mxz.common.entity.beans;

import com.myframework.smhj.hibernate.Entity;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.SEQUENCE;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * Shopping entity. @author MyEclipse Persistence Tools
 */
@javax.persistence.Entity
@Table(name = "MXZ_SHOPPING", schema = "MXZ")
public class Shopping extends Entity implements java.io.Serializable {

	// Fields

	private Long shoppingId;
	private StoreGoods storeGoods;
	private ShoppingCart shoppingCart;
	private Float buyCount;
	private Long memberId;

	// Constructors

	/** default constructor */
	public Shopping() {
	}

	/** full constructor */
	public Shopping(StoreGoods storeGoods, ShoppingCart shoppingCart,
			Float buyCount, Long memberId) {
		this.storeGoods = storeGoods;
		this.shoppingCart = shoppingCart;
		this.buyCount = buyCount;
		this.memberId = memberId;
	}

	// Property accessors
	@SequenceGenerator(name = "generator", sequenceName = "SEQ_SHOPPING")
	@Id
	@GeneratedValue(strategy = SEQUENCE, generator = "generator")
	@Column(name = "SHOPPING_ID", unique = true, nullable = false, precision = 15, scale = 0)
	public Long getShoppingId() {
		return this.shoppingId;
	}

	public void setShoppingId(Long shoppingId) {
		this.shoppingId = shoppingId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "STORE_GOODS_ID", nullable = false)
	public StoreGoods getStoreGoods() {
		return this.storeGoods;
	}

	public void setStoreGoods(StoreGoods storeGoods) {
		this.storeGoods = storeGoods;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CART_ID", nullable = false)
	public ShoppingCart getShoppingCart() {
		return this.shoppingCart;
	}

	public void setShoppingCart(ShoppingCart shoppingCart) {
		this.shoppingCart = shoppingCart;
	}

	@Column(name = "BUY_COUNT", nullable = false, precision = 8, scale = 1)
	public Float getBuyCount() {
		return this.buyCount;
	}

	public void setBuyCount(Float buyCount) {
		this.buyCount = buyCount;
	}

	@Column(name = "MEMBER_ID", nullable = false, precision = 15, scale = 0)
	public Long getMemberId() {
		return this.memberId;
	}

	public void setMemberId(Long memberId) {
		this.memberId = memberId;
	}

}